Fix bug 404506, caused by prematurely releasing a DC. By Hiroyuki Yamamoto
authorDom Lachowicz <domlachowicz@gmail.com>
Mon, 5 Feb 2007 14:30:06 +0000 (14:30 +0000)
committerDom Lachowicz <doml@src.gnome.org>
Mon, 5 Feb 2007 14:30:06 +0000 (14:30 +0000)
2007-02-05  Dom Lachowicz <domlachowicz@gmail.com>

        * modules/engines/ms-windows/msw_style.c: Fix bug 404506, caused
        by prematurely releasing a DC. By Hiroyuki Yamamoto
        * modules/engines/ms-windows/msw_style.c: Fix bug 403470 - leaking
        pixbufs when drawing rotated tabs. By Daniel Atallah

svn path=/trunk/; revision=17263

ChangeLog
modules/engines/ms-windows/msw_style.c

index ac222341f476240323a3bb25588d4566f1435ef5..ee01fe0424bf4befac522c4ccead44785ec09dbc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-05  Dom Lachowicz <domlachowicz@gmail.com>
+
+       * modules/engines/ms-windows/msw_style.c: Fix bug 404506, caused
+       by prematurely releasing a DC. By Hiroyuki Yamamoto
+       * modules/engines/ms-windows/msw_style.c: Fix bug 403470 - leaking 
+       pixbufs when drawing rotated tabs. By Daniel Atallah
+       
 2007-02-05  Michael Natterer  <mitch@imendio.com>
 
        * gtk/gtksettings.c: add new boolean settings gtk-enable-accels
index dcb34fd880e8730c7ba9930d8d9586cff57c64f2..a1d2bf6b7e7313ab23f9019f022023110195a7f8 100755 (executable)
@@ -466,12 +466,15 @@ sys_font_to_pango_font (XpThemeClass klazz, XpThemeFont type, char *buf,
                {
                    pt_size = -MulDiv (lf.lfHeight, 72,
                                       GetDeviceCaps (hDC, LOGPIXELSY));
-                   ReleaseDC (hwnd, hDC);
                }
            else
                pt_size = 10;
 
            font = get_family_name (&lf, hDC);
+
+           if (hDC)
+             ReleaseDC (hwnd, hDC);
+
            if(!(font && *font))
                return NULL;
 
@@ -1988,8 +1991,6 @@ draw_box (GtkStyle * style,
                {
                 RECT rect;
                 HDC dc;
-                gboolean rtl = (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL);
-                gboolean up = !strcmp (detail, "spinbutton_up");
 
                 dc = get_window_dc( style, window, state_type,
                                     x, y, width, height, &rect );
@@ -2409,7 +2410,6 @@ draw_extension (GtkStyle * style,
            int tab_part = XP_THEME_ELEMENT_TAB_ITEM;
            int real_gap_side = gtk_notebook_get_tab_pos (notebook);
            int border_width = gtk_container_get_border_width (GTK_CONTAINER (notebook));
-           gboolean last_tab;
 
            /* why this differs from the above gap_side, i have no idea... */
            if (real_gap_side == GTK_POS_LEFT)
@@ -2529,6 +2529,8 @@ draw_extension (GtkStyle * style,
 
                           gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, x2, y2, w2, h2, GDK_RGB_DITHER_NONE, 0, 0);
 
+                          g_object_unref (G_OBJECT (pixbuf));
+
                           if (real_gap_side == GTK_POS_LEFT || real_gap_side == GTK_POS_RIGHT)
                             {
                               g_object_unref (pixmap);